<template>
  <u-modal
    v-model="certificateTipShow"
    :width="'650'"
    class="modal1"
    title="提示"
    content="请您先进行资质认证"
    show-cancel-button
    @confirm="certificateTipConfirm"
    @cancel="certificateTipCancel"
    confirm-text="去认证">
  </u-modal>
</template>
<script>
export default {
  name: 'loadinginformationModal',
  props: {
    certificateTipShow: {
      type: Boolean,
      default: false
    },
    desc: {
      type: String,
      default: '通过审核后即可抢单运输'
    }
  },
  data() {
    return {}
  },
  methods: {
    certificateTipConfirm() {
      this.$emit('confirm')
      let userInfo = uni.getStorageSync('userInfo')
      if (
        userInfo.driverInfo == null ||
        userInfo.driverInfo.driverAuditStatus != 1
      ) {
        return uni.navigateTo({
          url: '/pages/auth/driver'
        })
      }
      if (userInfo.carInfo == null || userInfo.carInfo.carAuditStatus != 1) {
        return uni.navigateTo({
          url: '/pages/auth/car'
        })
      }
    },
    certificateTipCancel() {
      this.$emit('cancel', false)
    }
  }
}
</script>
<style lang="scss" scoped>
@import './modal.scss';
</style>
